package com.example.dzbsh.controller;

import com.example.dzbsh.service.CaozuojiluService;
import com.example.dzbsh.util.JsonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("caozuojilu")
public class CaozuojiluController {

    @Resource
    CaozuojiluService ddService;

    private Logger logger = LoggerFactory.getLogger(getClass());
    
    @RequestMapping("selectnum")
    public JsonResult<?> findBydeptId(
            @RequestParam("leixing") String ppLeixing){
        try {
            return JsonResult.getSuccessResult(ddService.selectNumByLeixing(ppLeixing));
        }catch(Exception e) {
            e.printStackTrace();
            logger.error("CaozuojiluController->selectnum:"+e.getMessage());
            return JsonResult.getErrorResult("查询失败！");
        }
    }

}
